import request from '@/utils/request'

export function tbMenuQuery(data) { //查询
    return request({
        method: 'get',
        url: 'tbSysMenu/query',
        params: data,
    })
}

export function tbMenuQueryData(data) { //查询菜单树形信息
    return request({
        method: 'get',
        url: 'tbSysMenu/queryData',
        params: data,
    })
}
export function tbMenuQueryHomeData(data) { //登录成功以后展示，返回菜单和按钮数据
    return request({
        method: 'get',
        url: 'tbSysMenu/queryHomeData/'+data,
    })
}

export function tbMenuAdd(data) { //新增
    return request({
        method: 'post',
        url: 'tbSysMenu/add',
        data,
    })
}

export function tbMenuUpdate(data) { //新增
    return request({
        method: 'post',
        url: 'tbSysMenu/update',
        data,
    })
}

export function tbMenuDelete(data) { // 删除一条菜单信息
    return request({
        method: 'get',
        url: 'tbSysMenu/delete/'+data,
    })
}


export function tbMenuTree(roleId) { //角色菜单授权页面
    return request({
        method: 'get',
        url: 'tbSysMenu/tree/'+roleId,
    })
}
